home *** CD-ROM | disk | FTP | other *** search
/ NBC Slam Jams! / NBC Slam Jams!.iso / xtras / media_la / fx_set_1.fxm / 00282_Script_Memory Script < prev    next >
Text File  |  1998-01-20  |  1KB  |  46 lines

  1. on mouseDown
  2.   put the clickLoc into cLoc
  3.   put the clickOn into c
  4.   put the locH of cLoc - the locH of sprite c into h
  5.   put the locV of cLoc - the locV of sprite c into v
  6.   
  7.   if h > 21 then exit -- need to click on either set or get
  8.   
  9.   if v > 13 then -- get
  10.     set action = "get"
  11.   else
  12.     set action = "set"
  13.   end if
  14.   
  15.   
  16.   repeat while the stillDown
  17.     put the mouseH - the locH of sprite c into h
  18.     put the mouseV - the locV of sprite c into v
  19.     put ((h-21)/18+1)+(v/13)*4 into n
  20.     if h < 21 or v < 0 or v > 26 or n < 1 or n > 8 then
  21.       set the member of sprite c = member ("memory"&&action)
  22.     else
  23.       set the member of sprite c = member ("memory"&&action&&n)
  24.     end if
  25.     updateStage
  26.   end repeat
  27.   
  28.   if h < 21 or v < 0 or v > 26 or n < 1 or n > 8 then exit -- not valid
  29.   
  30.   global fxTrackingObj, version
  31.   if not objectP(fxTrackingObj) then exit
  32.   
  33.   if value(char 1 to 3 of version) < 6 then
  34.     alert "Memory buttons require Director 6 or later."
  35.     exit
  36.   end if
  37.   
  38.   if action = "set" then
  39.     setMemory(fxTrackingObj,n)
  40.   else if action = "get" then
  41.     getMemory(fxTrackingObj,n)
  42.   end if
  43.   
  44.   set the member of sprite c = member ("memory")
  45.   puppetSprite c, FALSE
  46. end